package ltd.dujiabao.capability.domain.capmng.sync;

import java.time.LocalDateTime;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ltd.dujiabao.capability.domain.devmng.DevType;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/8 23:19
 * @Desc :
 */
public class SynchronizerBuilder {
    private final DevType devType;
    private final List<Worker> workers;

    private Map<String, Object> attributes = Collections.emptyMap();

    public SynchronizerBuilder(DevType devType, List<Worker> workers) {
        this.devType = devType;
        this.workers = workers;
    }

    public SynchronizerBuilder setAttributes(Map<String, Object> attributes) {
        this.attributes = new HashMap<>(attributes);
        return this;
    }

    public Synchronizer build() {
        return new Synchronizer(LocalDateTime.now(), 0L, devType, workers, attributes);
    }
}
